package com.example.demo.pojo;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

@Data
@Document(indexName = "pojo")
public class Pojo {
    @Id
    private String name;
    @Field(name = "sex")
    private String sex;
    @Field(format = DateFormat.basic_date_time,type= FieldType.Date)
    private Date birth;
}
